import request from '@/utils/request'

// 游戏统计数据 模块

// ---------------获取数据-----------------//

// LTV
export function playerLtv(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerLtv/data.auth',
    method: 'post',
    data: formData
  })
}

// 付费用户留存
export function firstPayRemain(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/firstPayRemain/data.auth',
    method: 'post',
    data: formData
  })
}

// 新增玩家留存
export function playerRemain(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerRemain/data.auth',
    method: 'post',
    data: formData
  })
}

// 基础数据（角色）
export function playerSummary(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerSummary/data.auth',
    method: 'post',
    data: formData
  })
}

// 新增付费留存
export function playerPayRemain(data) {
  const formData = new FormData()
  for (const key in data) {
    formData.append(key, data[key])
  }
  return request({
    url: '/playerPayRemain/data.auth',
    method: 'post',
    data: formData
  })
}

// ---------------其他-----------------//

// LTV-手动触发当天LTV数据统计
export function manualTodayLTV() {
  return request({
    url: '/playerLtv/manual.auth',
    method: 'post'
  })
}


// 付费用户留存-手动触发当天留存数据统计
export function manualTodayRemain() {
  return request({
    url: '/firstPayRemain/manual.auth',
    method: 'post'
  })
}


// 新增玩家留存-手动触发当天留存数据统计
export function manualTodayPlayerRemain() {
  return request({
    url: '/playerRemain/manual.auth',
    method: 'post'
  })
}

// 新增付费留存-手动触发当天付费留存数据统计
export function manualTodayPayRemain() {
  return request({
    url: '/playerPayRemain/manual.auth',
    method: 'post'
  })
}

// 基础数据（角色）-手动触发当天基础数据（角色）数据统计
export function manualTodayPlayerSum() {
  return request({
    url: '/playerSummary/manual.auth',
    method: 'post'
  })
}